home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 12 / Amiga Format AFCD12 (Apr 1997, Issue 96).iso / -readerstuff- / manolis_pappas / mathfx / examples / symbols2.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-29  |  1.2 KB  |  60 lines

  1. /* Displays the plotter symbols for FXSYM function. */
  2. /* Copyright (©) 1995, The Xperts Group Inc. All Rights Reserved. */
  3. /* Author: Manolis S Pappas. */
  4.  
  5. #include <stdio.h>
  6.  
  7. static int  base[17] = { 0, 200, 500, 600, 700, 800, 900,
  8.    2000,2100,2200,2300,2400,2500,2600,2700,2800,2900 };
  9.  
  10. main()
  11. {
  12.       char text[4];
  13.       int i, j, k, l;
  14.       float x, y;
  15.  
  16. /* Full sized page for display */
  17.  
  18.       fxstar(1,1);
  19.       for (l=0; l<17; l++)  {
  20.         fxadv(0);
  21.  
  22. /* Set up viewport and window */
  23.  
  24.         fxvpor(0.1,1.0,0.1,0.9);
  25.         fxwind(0.0,1.0,0.0,1.0);
  26.  
  27. /* Draw the grid using fxbox */
  28.  
  29.         fxbox("bcgt",0.1,0,"bcgt",0.1,0);
  30.  
  31. /* Write the digits below the frame */
  32.  
  33.         for (i=0; i<=9; i++)  {
  34.           sprintf(text,"%d",i);
  35.           fxmtex("b",1.5,0.1*i+0.05,0.5,text);
  36.         }
  37.     
  38.         k=0;
  39.         for (i=0; i<=9; i++)  {
  40.  
  41. /* Write the digits to the left of the frame */
  42.  
  43.           sprintf(text,"%d",base[l]+10*i);
  44.           fxmtex("lv",1.0,0.95-0.1*i,1.0,text);
  45.           for (j=0; j<=9; j++) {
  46.             x=0.1*j+0.05;
  47.             y=0.95-0.1*i;
  48.  
  49. /* Display the symbols */
  50.  
  51.             fxsym(1,&x,&y,base[l]+k);
  52.             k=k+1;
  53.           }
  54.         }
  55.  
  56.         fxmtex("t",1.5,0.5,0.5,"FXSYM symbol library.");
  57.       }
  58.       fxend();
  59. }
  60.